<template>
  <div class="student-page">
    <el-card shadow="never" border="false">
      <template #header>
        <div class="header">
          <span>学员管理</span>
          <el-button icon="el-icon-plus" size="small" type="primary" round>
            添加学员
          </el-button>
        </div>
         <el-table :data="list" stripe :border="true" style="width: 100%" :fit="true" cell-style="text-align:center">
        <el-table-column label="ID" align="center">
          <template slot-scope="scope">
            <span style="margin-left: 10px">{{ scope.row.id }}</span>
          </template>
        </el-table-column>
        <el-table-column label="姓名" align="center">
          <template slot-scope="scope">
            <div>{{ scope.row.name }}</div>
          </template>
        </el-table-column>
        <el-table-column label="年龄" align="center">
          <template slot-scope="scope">
            <div>{{ scope.row.age }}</div>
          </template>
        </el-table-column>
        <el-table-column label="性别" align="center">
          <template slot-scope="scope">
            <div>{{ scope.row.sex }}</div>
          </template>
        </el-table-column>
        <el-table-column label="组号" width="60" align="center">
          <template slot-scope="scope">
            <div>{{ scope.row.group }}</div>
          </template>
        </el-table-column>
        <el-table-column label="联系电话" align="center">
          <template slot-scope="scope">
            <div>{{ scope.row.phone }}</div>
          </template>
        </el-table-column>
        <el-table-column label="期望薪资" align="center">
          <template slot-scope="scope">
            <div>{{ scope.row.salary }}</div>
          </template>
        </el-table-column>
        <el-table-column label="实际薪资" align="center">
          <template slot-scope="scope">
            <div>{{ scope.row.truesalary }}</div>
          </template>
        </el-table-column>
        <el-table-column label="籍贯" width="250" align="center">
          <template slot-scope="scope">
            <div>{{ scope.row.province + scope.row.city + scope.row.county }}</div>
          </template>
        </el-table-column>
        <el-table-column label="操作" width="180" align="center">
          <template slot-scope="scope">
            <el-button size="mini" style="background-color: #0d6efd; color: #fff" >修改</el-button>
            <el-button size="mini" type="danger"  style="background-color: #dc3545">删除</el-button>
          </template>
        </el-table-column>
      </el-table>
      </template>
    </el-card>
  </div>
</template>

<script>
import { getLayoutAPI } from '@/api/user'
export default {
  name: 'StudentIndex',
  data () {
    return {
      list: []
    }
  },
  async created () {
    const res = await getLayoutAPI()
    this.list = res.data.data
  }
}
</script>

<style lang="scss" scoped>
.el-card {
  .header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-right: 16px;
  }
  .actions {
    font-size: 18px;
    display: flex;
    justify-content: space-around;
    color: #666;
    > i:hover {
      color: rgba(114, 124, 245, 1);
      cursor: pointer;
    }
  }
}
</style>
